﻿using System.Diagnostics.Contracts;
using System.Reactive.Disposables;

namespace System.Reactive.Concurrency
{
	[ContractClass(typeof(ISchedulerLongRunningContract))]
	public interface ISchedulerLongRunning
	{
		IDisposable ScheduleLongRunning<TState>(TState state, Action<TState, ICancelable> action);
	}

	[ContractClassFor(typeof(ISchedulerLongRunning))]
	internal abstract class ISchedulerLongRunningContract : ISchedulerLongRunning
	{
		public IDisposable ScheduleLongRunning<TState>(TState state, Action<TState, ICancelable> action)
		{
			Contract.Requires(action != null, null, "action != null");
			Contract.Ensures(Contract.Result<IDisposable>() != null, null, "Contract.Result<IDisposable>() != null");
			return null;
		}
	}
}